package cn.iocoder.yudao.module.blog.dal.mysql.improve;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.improve.BlogImproveDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.improve.vo.*;

/**
 * 课程 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogImproveMapper extends BaseMapperX<BlogImproveDO> {

    default PageResult<BlogImproveDO> selectPage(BlogImprovePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogImproveDO>()
                .likeIfPresent(BlogImproveDO::getName, reqVO.getName())
                .eqIfPresent(BlogImproveDO::getType, reqVO.getType())
                .betweenIfPresent(BlogImproveDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogImproveDO::getId));
    }

    default List<BlogImproveDO> selectList(BlogImproveExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogImproveDO>()
                .likeIfPresent(BlogImproveDO::getName, reqVO.getName())
                .eqIfPresent(BlogImproveDO::getType, reqVO.getType())
                .betweenIfPresent(BlogImproveDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogImproveDO::getId));
    }

}
